package com.me.db;

import com.me.util.AppUtil;

import android.provider.CalendarContract.Calendars;
import android.provider.CalendarContract.Instances;

public class CalendarQuery {

	public static final String ACCOUNT_TYPE = "com.google";
	public static final String ORDER_ASCENDING = " asc";
	public static final String ORDER_DESCENDING = " dsc";

	public static class Calendar {

		// select clause
		public static final String[] PROJECTION = new String[] { Calendars._ID,
				Calendars.ACCOUNT_NAME, Calendars.ACCOUNT_TYPE };

		public static final int INDEX_ID = 0;
		public static final int INDEX_ACCOUNT_NAME = 1;
		public static final int INDEX_ACCOUNT_TYPE = 2;

		// where clause
		public static final String SELECTION = Calendars.ACCOUNT_TYPE + " = ?"
				+ " and " + Calendars.ACCOUNT_NAME + " = "
				+ Calendars.CALENDAR_DISPLAY_NAME;
		public static final String[] ARGUMENT = new String[] { ACCOUNT_TYPE };

		// order by
		public static final String COLUMN_ID = "Calendars._ID";
	}

	public static class Instance {

		// select clause
		public static final String[] PROJECTION = { Instances.EVENT_ID,
				Instances.TITLE, Instances.ALL_DAY, Instances.DTSTART,
				Instances.DTEND, Instances.EVENT_LOCATION };

		public static final int INDEX_EVENT_ID = 0;
		public static final int INDEX_EVENT_TITLE = 1;
		public static final int INDEX_EVENT_ALL_DAY = 2;
		public static final int INDEX_EVENT_START = 3;
		public static final int INDEX_EVENT_END = 4;
		public static final int INDEX_EVENT_LOCATION = 5;

		// where clause
		public static final String SELECTION = Instances.CALENDAR_ID + " = ?";

		public static final String[] ARGUMENT = new String[] { AppUtil.App.currCalendarId };

		// order by
		public static final String COLUMN_ID = "Instances.BEGIN";

	}

}
